<?php
declare (strict_types=1);

namespace app\wap\controller;

class Borrow extends Base
{
    /**
     * index #记录
     * api get /{controller}/{method}
     *
     * @auth kouweihong
     * @date 2020/12/2
     */
    public function index()
    {
        $pageSize = 15;
        $page = input('page', 1);

        $where = ['user_type' => $this->auth->user_type, 'user_id' => $this->auth->id];
        $list = \app\common\model\Borrow::with(['book'])->where($where)->order('id desc')->paginate($pageSize);

        $this->success($list);
    }
}
